﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace IngredSubTool
{
    /// <summary>
    /// Interaction logic for SubmitSuccessView.xaml
    /// </summary>
    /// 



    public partial class SubmitSuccessView : UserControl, IAppPage
    {
       
        private String successMsg = "Thank you for your submission.\n It is now being reviewed by our moderators.\n To view your submission, click My Substitutions.";
        private String successPrivate = "Your private submission can be now viewed by clicking My Substitutions.";

        public SubmitSuccessView(Boolean isPrivate)
        {
            InitializeComponent();
            Menu.Content = new SideMenu();
            setupText(isPrivate);

        }

        private void setupText(Boolean isPrivate) {
            if (isPrivate) {
                SuccessText.Text = successPrivate;
            } else {
                SuccessText.Text = successMsg;
            }
        }

        private void GoHome(object sender, RoutedEventArgs e)
        {
            MainWindow.session.previousPagesList.Clear();
            PageSwitcher.SwitchForward(new SearchView());
               
        }

        private void GoMySub(object sender, RoutedEventArgs e)
        {
            MainWindow.session.previousPagesList.Clear();
            MainWindow.session.previousPagesList.AddFirst(typeof(SearchView));
            MainWindow.session.currentPage = typeof(SearchView);
            PageSwitcher.SwitchForward(new MySubstitutionView());
        }
    }
}
